This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
You do not have to use views for that.
Below is the code I use for years to prevent uses from pasting docs. I use a settings doc (avaialbel to admins only) to turn pasting on or off:
Function PreventDocPaste
%REM
This Function prevents any user from pasting docs in the db
- any pasted doc is marked as deleted by changing the form to "DeleteMe"
- the PastedBy and PastedOn fields are set to the current user name and date time stamp
- A value of "ALLOW" in the AllowDocPaste settings doc
%END REM
Dim session As New NotesSession
Dim db As NotesDatabase
Dim viewAdmin As NotesView
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim docAdmin As NotesDocument
Set db = session.CurrentDatabase
Set viewAdmin = db.GetView( "AdminSettings" )
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument
REM check if doc pasting is allow at this time
Set docAdmin = viewAdmin.GetDocumentByKey( "AllowDocPaste" , True )
If Not docAdmin Is Nothing Then
If Ucase( docAdmin.Field1(0) ) = "ALLOW" Then
REM allow pasting docs
Exit Function
End If
End If
Msgbox "You cannot paste documents in this application." , 16 , "Application Auto-protection"
While Not doc Is Nothing
doc.PastedBy = session.UserName
doc.PastedOn = Now
doc.DeletedDate = doc.PastedOn(0)
doc.DeletedBy = doc.PastedBy
doc.OldForm = doc.Form(0)
doc.Form = "DeleteMe"
Call doc.Save( True , False )
REM
Set doc = collection.GetNextDocument( doc )
Wend
End Function
Feedback response number WEBB7PFRG3 created by ~Isaac Quetnutex on 02/20/2009